package Collestions_demo;

import java.util.Objects;

public class Point1 {
    int x;

    @Override
    public String toString() {
        return "Point1{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }

    public int getX() {
        return x;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Point1)) return false;
        Point1 point1 = (Point1) o;
        return getX() == point1.getX() &&
                getY() == point1.getY();
    }

    @Override
    public int hashCode() {
        return Objects.hash(getX(), getY());
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    int y;

    Point1(int x, int y){
        this.x = x;
        this.y = y;
    }
}
